package edu.byu.intex2.data.bo;

import edu.byu.intex2.data.DataException;
import edu.byu.intex2.data.dao.ConceptualCarDAO;

/**
 * Conceptual Car represents the idea of a car, but not its physical existence.
 * @author Brady White
 */
public class ConceptualCar extends BusinessObject {
    private String make;
    private String model;
    private int year;
    private double basePrice;

    /** Creates a new instance of BusinessObject */
    public ConceptualCar(String id) {
        super(id);
    }//constructor

    /** Convenience method to call the correct DAO to save this business object */
    public void save() throws DataException {
        try {
            ConceptualCarDAO.getInstance().save(this);
        } catch (DataException e) {
            e.printStackTrace();
        }
    }
    /**
     * @return the make
     */
    public String getMake() {
        return make;
    }

    /**
     * @param make the make to set
     */
    public void setMake(String make) {
        this.make = make;
        setDirty(true);
    }

    /**
     * @return the model
     */
    public String getModel() {
        return model;
    }

    /**
     * @param model the model to set
     */
    public void setModel(String model) {
        this.model = model;
        setDirty(true);
    }

    /**
     * @return the year
     */
    public int getYear() {
        return year;
    }

    /**
     * @param year the year to set
     */
    public void setYear(int year) {
        this.year = year;
        setDirty(true);
    }

    /**
     * @return the basePrice
     */
    public double getBasePrice() {
        return basePrice;
    }

    /**
     * @param basePrice the basePrice to set
     */
    public void setBasePrice(double basePrice) {
        this.basePrice = basePrice;
        setDirty(true);
    }
}
